﻿package DevilCat{
	import flash.display.MovieClip ;
	import flash.text.TextField ;
	import flash.events.MouseEvent; 
	import flash.events.Event;    
	import fl.transitions.Tween;
	import fl.transitions.easing.*;
	import fl.transitions.TweenEvent;
	public class FloatingText extends MovieClip  {
		var attackTextAlpha:Tween;
		var attackTexty:Tween
		public function FloatingText(Content:String,tx:Number,ty:Number,tTime=2) {
			this.x=tx;
			this.y=ty;
			this.FloatContent.text=Content;
			//trace(Content);
			attackTextAlpha = new Tween (this,"alpha",Regular.easeOut,1,0,tTime,true);
			attackTexty = new Tween (this,"y",Regular.easeOut,ty,ty-20,tTime,true);
			attackTextAlpha.addEventListener(TweenEvent.MOTION_FINISH,removeMe);
		}
		public function removeMe(e:Event){
			if(this.parent != null){
				this.parent.removeChild(this);
				//trace ("Removed");
			}
		}
	}
}